﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Castle.ActiveRecord;
using System.ComponentModel.DataAnnotations;

namespace ZDSoft.LMS.Domain
{
    /// <summary>
    /// 报帐单
    /// </summary>
    [ActiveRecord]
    public class Billing:EntityBase
    {
        /// <summary>
        /// 送货单
        /// </summary>
        [BelongsTo(Type = typeof(DeliveryForm), Column = "DeliveryFormID", Lazy = FetchWhen.OnInvoke)]
        public DeliveryForm DeliveryForm
        { get; set; }

        /// <summary>
        /// 报销日期
        /// </summary>
        [Property]
        public DateTime CreateDate { get; set; }

        /// <summary>
        /// 创建人
        /// </summary>
        [BelongsTo(Type=typeof(User),Column="CreatorID",Lazy=FetchWhen.OnInvoke)]
        public User Creator { get; set; }
       
        /// <summary>
        /// 报销单明细
        /// </summary>
        [HasMany(typeof(BillingItem), Table = "BillingItem", ColumnKey = "BillingID", Lazy = true)]
        public IList<BillingItem> Items { get; set; }
    }
}
